import http from './../../../base/api/public'
import querystring from 'querystring'
let sysConfig = require('@/../config/sysConfig')
let apiUrl = sysConfig.xcApiUrlPre;

/*页面列表*/
export const media_list = (page,size,params) => {
  //params为json格式
  //使用querystring将json对象转成key/value串
  let querys = querystring.stringify(params)
  return http.requestQuickGet(apiUrl+'/media/file/list/'+page+'/'+size+'/?'+querys)
}
/*文件夹映射*/
export const folderMapping = () => {
  return http.requestQuickGet(apiUrl+'/media/upload/folderMapping')
}
/*添加一个文件夹*/
export const folderAdd = (folderMappingRequest) => {
  return http.requestPost(apiUrl+'/media/upload/folderAdd/', folderMappingRequest)
}

/*删除一个文件夹*/
export const folderDel = (folderMappingRequest) => {
  // delete请求必须要用data传递,不然后台收不到数据
  return http.requestDelete(apiUrl+'/media/upload/folderDel/', {data:folderMappingRequest})
}
